﻿Public Class Buscar

    Function buscar(ByVal nombre As String, ByVal tipo_comida As String, ByVal distrito As String) As Collection

        Dim modelo As New Restaurante
        modelo.nombre = nombre
        modelo.tipo_comida = tipo_comida
        modelo.distrito = distrito

        Dim dao As New RestauranteDAO

        Return dao.buscar(modelo)

    End Function

    Function buscartodo(ByVal nombre As String, ByVal tipo_comida As String, ByVal distrito As String, ByVal direccion As String, ByVal ruc As String) As Collection

        Dim modelo As New Restaurante
        modelo.nombre = nombre
        modelo.tipo_comida = tipo_comida
        modelo.distrito = distrito
        modelo.direccion = direccion
        modelo.ruc = ruc

        Dim dao As New RestauranteDAO

        Return dao.buscartodo(modelo)

    End Function

    Function buscaroferxrest(ByVal nombre As String) As Collection

        Dim modelo As New Restaurante
        modelo.nombre = nombre

        Dim dao As New OfertaDAO

        Return dao.buscar(modelo)

    End Function

    Function buscaroferxdesc(ByVal rest As String, ByVal desc As String, ByVal fi As String, ByVal ff As String) As Collection

        Dim todo As New todo

        todo.nombre = rest
        todo.descripcion = desc
        todo.fecha_inicio = fi
        todo.fecha_fin = ff

        Dim dao As New OfertaDAO

        Return dao.buscarxnombre(todo)

    End Function

End Class
